package org.firebug.spring.boot.event;

import org.springframework.context.event.ApplicationContextEvent;
import org.springframework.context.event.ContextStartedEvent;
import org.springframework.context.event.ContextStoppedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class MyApplicationListener {
    @EventListener
    public void object(Object event) {
        System.out.println("Object：" + event.getClass());
    }
    @EventListener
    public void applicationContextEvent(ApplicationContextEvent event) {
        System.out.println("ApplicationContextEvent：" + event.getClass());
    }
    @EventListener
    public void contextStartedEvent(ContextStartedEvent event) {
        System.out.println("ContextStartedEvent：" + event.getClass());
    }
    @EventListener
    public void contextStoppedEvent(ContextStoppedEvent event) {
        System.out.println("ContextStoppedEvent：" + event.getClass());
    }
    @EventListener
    public void myApplicationEvent(MyApplicationEvent event) {
        System.out.println("MyApplicationEvent：" + event.getClass());
    }
}
